﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TushuGuan_GUI
{
    public class Management
    {
        public StudentList Students { get; set; }
        public BookList Books { get; set; }

        public Management()
        {
            Students = new StudentList();
            Books = new BookList();
        }
        public List<BookBorrowedPlus> AllLendBooks()
        {
            //遍历学生列表
            return Students.AllLendBooks();
        }
        public List<BookBorrowedPlus> AllOverdueLendBooks()
        {
            //遍历学生列表
            return Students.AllOverdueLendBooks();
        }
        public void LendBook(string isbn,string studentId,int limited=5)
        {
            Books.LendBook(isbn, studentId);
            Students.LendBook(isbn, studentId, limited);
        }
        public void ReturnBook(string isbn, string studentId)
        {
            Students.ReturnBook(isbn, studentId);
            Books.ReturnBook(isbn, studentId);
        }

        public List<Book> SearchBooks(string isbn)
        {
            return Books.SearchBooks(isbn);
        }
        public List<Student> SearchStudents(string studentId)
        {
            return Students.SearchStudents(studentId);
        }
        public void RemoveBook(string iSBN)
        {
            Books.RemoveBook(iSBN);

        }
        public bool RemoveBook(List<int> booksRemove)
        {
            
            return Books.RemoveBook(booksRemove);
        }
        public bool RemoveStudents(List<int> studentsRemove)
        {

            return Students.RemoveStudents(studentsRemove);
        }
        public void Addbook(string iSBN)
        {
            Books.Addbook(iSBN);
        }
        public void AddStudent(string studentId)
        {
            Students.AddStudent(studentId);
        }

    }
}
